package com.caocaog.market.finance.vo;

import com.caocaog.market.finance.entity.MkBillLine;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
@NoArgsConstructor
public class MkBillLineVo {

    @ApiModelProperty(value = "ID")
    private String id;
    @ApiModelProperty(value = "订单号，对应MkBillBase对象中的orderNo")
    private String orderNo;

    @ApiModelProperty(value = "账单id，对应MkBillBase对象中的id")
    private String billBaseId;

    @Excel(name = "实付金额", width = 15, type = 4, isStatistics = true)
    private transient String payAmount;


    /**
     * 提成比例（门店没有抽成比例，存：1 - 总部抽成比例 - 分站抽成比例）
     */
    @Excel(name = "佣金比例", width = 15, type = 4)
    @ApiModelProperty(value = "抽成比例")
    private String rakeRate;

    @Excel(name = "本单收益", width = 15, type = 4, isStatistics = true)
    @ApiModelProperty(value = "抽成金额")
    private String rakeAmount;

    @Excel(name = "审核状态", dicCode = "bill_withdraw_cash_status", width = 15)
    @ApiModelProperty(value = "提现状态，提现状态（1待提现（可提现）、2已提出提现申请待总部审核（审核中）、3提现申请审核通过待转账（待转账）、4提现申请被驳回（被驳回）、5已提现、6提现失败）")
    @Dict(dicCode = "bill_withdraw_cash_status")
    private Integer withdrawCashStatus;

    /**
     * （1系统、2分站、3门店）
     */
    @Excel(name = "提现类型", dicCode = "bill_line_type", width = 15)
    @ApiModelProperty(value = "抽成各方类型")
    @Dict(dicCode = "bill_line_type")
    private int type;


    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @Excel(name = "结算时支付宝姓名", width = 15)
    @ApiModelProperty(value = "抽成人姓名")
    private String rakeAliname;

    @Excel(name = "批量审核单号", width = 50)
    @ApiModelProperty("批量审核单号")
    private String auditNo;

    public MkBillLineVo(MkBillLine mkBillLine) {
        this.id = mkBillLine.getId();
        this.orderNo = mkBillLine.getOrderNo();
        this.billBaseId = mkBillLine.getBillBaseId();
        this.payAmount = mkBillLine.getPayAmount();
        this.rakeRate = mkBillLine.getRakeRate();
        this.rakeAmount = mkBillLine.getRakeAmount();
        this.withdrawCashStatus = mkBillLine.getWithdrawCashStatus();
        this.type = mkBillLine.getType();
        this.createTime = mkBillLine.getCreateTime();
        this.rakeAliname = mkBillLine.getRakeAliname();
        this.auditNo = mkBillLine.getAuditNo();
    }
}
